package cn.hywx.convert;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class OfficeMain {
	final private static int task = Runtime.getRuntime().availableProcessors() + 3;// 返回处理器个数+3制定任务数量
	final private static ExecutorService consumerservice = Executors
			.newFixedThreadPool(task);
	final private static ExecutorService producerservice = Executors
			.newSingleThreadExecutor();
	private static int volumn = 100;
	
	public static void main(String [] args){
		OfficeQueue q = new OfficeQueue(volumn);
		producerservice.submit(new OfficeProducer(q));
		for(int i=0;i<task;++i){
			consumerservice.submit(new OfficeConsumer(q));
		}
	}
	
	
}
